/*
* @Author: w1583
* @Date:   2017-06-01 23:46:40
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-06-01 23:52:38
*/

#include <stdio.h>
#include <string.h>
#define MAXN 100+10
int a[MAXN];
int main() {
	int i,j,n,k,first=1;
	memset(a,0,sizeof(a));
	scanf("%d%d",&n,&k);
	for (int i = 0; i <=k; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
				if (j%i==0)
				{
					a[j]=!a[j];
				}
		}
	}
	for (int i = 0; i <=n; ++i)
	{
		if (a[i])
		{
			if (first)
			{
				first=0;
			}else{
				printf(" ");
				printf("%d ", i);
			}
		}
	}
	printf("\n");
    return 0;
}